package org.example.util5;


public class ManagerTest {
    public static void main(String[] args) {
        Manager boss = new Manager("cc", 8080.0,1999,12,15);
        boss.setBonus(5000);

        Employee[] staff = new Employee[3];
        staff[0] = boss;
        staff[1] = new Manager("aa", 8080.0,1999,12,15);
        staff[2] = new Manager("Two", 2222.0,2999,12,15);
        for(Employee e : staff){
            System.out.println("Name=" + e.getName() + ",salary="+e.getSalary());
        }
        /**
         * for each循环：依次处理数组中的每个元素，不必指定下标
         * 语句格式：for(variable : collection)
         *  collection 这一集合表达式必须是一个数组或者是一个实现了 Iterable 接口的类对象（例如 ArrayList)。
         */
    }
}
